/*
CREDITS:
Sprite - Hmm, this railgun was around here for so long that I really dunno who originally made it...
Sounds - ID Software, Raven Software, El Mudo
Pickup - By me, but this is such simpletonish edit that I should rather dig myself in forest for even trying to credit it, duh.

Special props to Icytux for sweetass refining of El Mudo's gibberish talk with extra, sick rave beats!
*/

actor PowercubePickup : CustomInventory
{
	Inventory.PickupMessage "Picked up the ''Powercube'', descendant of raveocalypse! Looks like an ordinary energy cell, but it definitely ain't a one! (1)"
	Inventory.PickupSound "Cube/Pickup"
	DropItem "Powercube"
	+FLOAT
	+FLOATBOB
	States
	{
		Spawn:
		CUBX ABCDEFGH 2 A_PlaySound("Cube/Roll",5,1.0,1)
		Loop
		Pickup:
		TNT1 A 0 A_JumpIfInventory("Powercube",1,"Bailure")
		Goto Success
		Bailure:
		CUBX ABCDEFGH 2
		Fail
		Success:
		TNT1 A 0 A_StopSound(5)
		TNT1 A 0 A_GiveInventory("Powercube")
		Stop
	}
}

ACTOR Powercube : Weapon 24528
{
	//$Category Weapons
	//$Title Powercube
	//$Sprite CUBXA0
   	Weapon.AmmoType1 "CubeAmmo"
   	Weapon.AmmoUse1 0
	Weapon.AmmoGive 100
   	Weapon.AmmoType2 "CubeAmmo"
   	Weapon.AmmoUse2 1
    Weapon.Kickback 50
   	Weapon.UpSound "Cube/Up"
    Inventory.PickupSound "Cube/Pickup"
	Weapon.SelectionOrder 7
   	Weapon.SlotNumber 1
	Inventory.PickupMessage "Picked up the ''Powercube'', descendant of raveocalypse! Looks like an ordinary energy cell, but it definitely isn't a one! (1)"
	Obituary "%o got caught into a %k's portable lightning storm, caused by %k's ''Powercube''."
	+WEAPON.NOAUTOFIRE
   	+AMMO_OPTIONAL
   	+ALT_AMMO_OPTIONAL
	+FLOAT
	+FLOATBOB
   	States
   	{
	Spawn:
		CUBX ABCDEFGH 2
		Loop
  	Ready:
      	CUBG A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
		Loop
   	Deselect:
		CUBG A 0 A_StopSound(6)
		CUBG A 0 A_StopSound(5)
      	CUBG A 1 A_Lower
        CUBG A 0 A_Lower
      	Loop
	Select:
		CUBG A 1 A_Raise
      	CUBG A 0 A_Raise
      	Loop
	Fire:
		CUBG A 0 A_JumpIfNoAmmo("Ready")
		CUBG BCDEFGH 1
      	CUBG A 0 A_GiveInventory("CubeAmmo",1)
		CUBG IJ 1
		CUBG A 0 A_PlaySound("Cube/Start",5,0.6)
		CUBG A 0 A_PlaySound("Cube/Loop",6,0.8,1)
	Hold:
		CUBF A 0 A_JumpIfNoAmmo("SuperPootisMan2")
		CUBF A 0 A_Quake (2, 12, 0, 3, none)
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.98)
		CUBF A 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),1,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.9775)
		CUBF B 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.975)
		CUBF C 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.9725)
		CUBF D 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.975)
		CUBF E 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.9775)
		CUBF F 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		
		CUBF A 0 A_GiveInventory("CubeAmmo",1)

		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.98)
		CUBF A 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),1,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.9775)
		CUBF B 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.975)
		CUBF C 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.9725)
		CUBF D 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.975)
		CUBF E 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_SetBlend("Green",0.05,1)
		CUBF A 0 A_Recoil(0.2)
		CUBF A 0 A_SetAngle(Angle+frandom(0.7,-0.7))
		CUBF A 0 A_SetPitch(Pitch+frandom(0.7,-0.7))
		CUBF A 0 A_ZoomFactor(0.9775)
		CUBF F 1 BRIGHT A_FireCustomMissile("CubeLightning",0.1*random(40,-40),0,15,0,0,0.1*random(40,-40))
		CUBF A 0 A_ReFire
		Goto SuperPootisMan
	SuperPootisMan2:
		CUBG A 0 A_ClearReFire
	SuperPootisMan:
		CUBF A 0 A_SetBlend("Green",0.05,10)
		CUBF A 0 A_Quake (2, 5, 0, 3, none)
		CUBG A 0 A_PlaySound("Cube/End",6,0.8)
		CUBG J 1 A_ZoomFactor(0.98)
		CUBG J 1 A_ZoomFactor(0.985)
		CUBG J 1 A_ZoomFactor(0.99)
		CUBG J 1 A_ZoomFactor(0.995)
		CUBG J 1 A_ZoomFactor(1)
		CUBG IHGFEDCBA 1
		Goto Ready
	AltFire:
		CUBG A 0 A_JumpIfNoAmmo("Ready")
		CUBG BCDEFGH 1
      		CUBG A 0 A_GiveInventory("CubeAmmo",1)
		CUBG IJ 1
		CUBG A 0 A_PlaySound("Cube/Chaccaron",5,1.0,1)
		CUBG A 0 A_PlaySound("Cube/Loop",6,0.5,1)
	AltHold:
		CUBF A 0 A_JumpIfNoAmmo("SupersitooPMan2")
		CUBF A 0 A_Quake (4, 6, 0, 3, none)
		CUBF A 0 A_SetBlend("Green",0.2,1)
		CUBF A 0 A_Recoil(0.4)
		CUBF A 0 A_SetAngle(Angle+frandom(1.0,-1.0))
		CUBF A 0 A_SetPitch(Pitch+frandom(1.0,-1.0))
		CUBF A 0 A_ZoomFactor(0.98)
		CUBF A 0 A_FireCustomMissile("WTFRocketRed",frandom(15.000,-15.000),1,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallRed",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketGreen",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallGreen",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketYellow",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallYellow",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketBlue",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBall",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 1 BRIGHT
		CUBF A 0 A_SetBlend("Yellow",0.2,1)
		CUBF A 0 A_Recoil(0.4)
		CUBF A 0 A_SetAngle(Angle+frandom(1.0,-1.0))
		CUBF A 0 A_SetPitch(Pitch+frandom(1.0,-1.0))
		CUBF A 0 A_ZoomFactor(0.9775)
		CUBF A 0 A_FireCustomMissile("WTFRocketRed",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallRed",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketGreen",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallGreen",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketYellow",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallYellow",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketBlue",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBall",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF B 1 BRIGHT
		CUBF A 0 A_SetBlend("Cyan",0.2,1)
		CUBF A 0 A_Recoil(0.4)
		CUBF A 0 A_SetAngle(Angle+frandom(1.0,-1.0))
		CUBF A 0 A_SetPitch(Pitch+frandom(1.0,-1.0))
		CUBF A 0 A_ZoomFactor(0.975)
		CUBF A 0 A_FireCustomMissile("WTFRocketRed",frandom(15.000,-15.000),1,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallRed",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketGreen",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallGreen",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketYellow",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallYellow",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketBlue",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBall",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF C 1 BRIGHT 
		CUBF A 0 A_SetBlend("Orange",0.2,1)
		CUBF A 0 A_Recoil(0.4)
		CUBF A 0 A_SetAngle(Angle+frandom(1.0,-1.0))
		CUBF A 0 A_SetPitch(Pitch+frandom(1.0,-1.0))
		CUBF A 0 A_ZoomFactor(0.9725)
		CUBF A 0 A_FireCustomMissile("WTFRocketRed",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallRed",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketGreen",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallGreen",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketYellow",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallYellow",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketBlue",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBall",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF D 1 BRIGHT
		CUBF A 0 A_SetBlend("Blue",0.2,1)
		CUBF A 0 A_Recoil(0.4)
		CUBF A 0 A_SetAngle(Angle+frandom(1.0,-1.0))
		CUBF A 0 A_SetPitch(Pitch+frandom(1.0,-1.0))
		CUBF A 0 A_ZoomFactor(0.975)
		CUBF A 0 A_FireCustomMissile("WTFRocketRed",frandom(15.000,-15.000),1,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallRed",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketGreen",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallGreen",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketYellow",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallYellow",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketBlue",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBall",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF E 1 BRIGHT
		CUBF A 0 A_SetBlend("Red",0.2,1)
		CUBF A 0 A_Recoil(0.4)
		CUBF A 0 A_SetAngle(Angle+frandom(1.0,-1.0))
		CUBF A 0 A_SetPitch(Pitch+frandom(1.0,-1.0))
		CUBF A 0 A_ZoomFactor(0.9775)
		CUBF A 0 A_FireCustomMissile("WTFRocketRed",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallRed",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketGreen",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallGreen",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketYellow",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBallYellow",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFRocketBlue",frandom(15.000,-15.000),0,0,0,0,frandom(15.000,-15.000))
		CUBF A 0 A_FireCustomMissile("WTFPlasmaBall",frandom(15.000,-15.000),0,0,0,0,frandom(5.000,-15.000))
		CUBF F 1 BRIGHT
		CUBF A 0 A_ReFire
		Goto SupersitooPMan
	SupersitooPMan2:
		CUBG A 0 A_ClearReFire
	SupersitooPMan:
		CUBF A 0 A_StopSound(5)
		CUBF A 0 A_SetBlend("Green",0.05,10)
		CUBF A 0 A_Quake (2, 5, 0, 3, none)
		CUBG A 0 A_PlaySound("Cube/End",6,0.6)
		CUBG J 1 A_ZoomFactor(0.98)
		CUBG J 1 A_ZoomFactor(0.985)
		CUBG J 1 A_ZoomFactor(0.99)
		CUBG J 1 A_ZoomFactor(0.995)
		CUBG J 1 A_ZoomFactor(1)
		CUBG IHGFEDCBA 1
		Goto Ready
	Reload:
		CUBG A 0 A_JumpIfInventory("ErasusCasing",100,"FuckYes")
		CUBG A 0 A_Print("You need at least 100 shell casings to activate this!")
		CUBG A 0 A_PlaySound("Weapons/MegaShellNope",1)
		CUBG A 20 A_WeaponReady
		Goto Ready
	FuckYes:
		CUBG A 0 A_PlaySound("Cube/Power",5)
		CUBG A 0 A_TakeInventory("ErasusCasing",100)
		CUBG A 0 A_Jump(255,"InfiniteAmmo","Invicibility","DoubleDamage","Protection","Fear")
	InfiniteAmmo:
		CUBG A 0 A_Print("Temporary infinite ammo granted.")
		CUBG A 0 A_GiveInventory("CubeInfiniteAmmo",1)
		CUBG A 0 A_SetBlend("70 0 99",0.4,35)
		Goto Cooldown
	Invicibility:
		CUBG A 0 A_Print("Temporary invicibility granted.")
		CUBG A 0 A_GiveInventory("CubeInvicibility",1)
		CUBG A 0 A_SetBlend("Orange",0.4,35)
		Goto Cooldown
	DoubleDamage:
		CUBG A 0 A_Print("Temporary double damage granted.")
		CUBG A 0 A_GiveInventory("CubeDamage",1)
		CUBG A 0 A_SetBlend("Red",0.4,35)
		Goto Cooldown
	Protection:
		CUBG A 0 A_Print("Temporary damage reduction granted.")
		CUBG A 0 A_GiveInventory("CubeProtection",1)
		CUBG A 0 A_SetBlend("Cyan",0.4,35)
		Goto Cooldown
	Fear:
		CUBG A 0 A_Print("Temporary fear-inducing granted.")
		CUBG A 0 A_GiveInventory("CubeFear",1)
		CUBG A 0 A_SetBlend("Yellow",0.4,35)
		Goto Cooldown
	Cooldown:
		CUBG A 35
		Goto Ready
   	}
}

ACTOR CubeAmmo : Ammo
{
	Inventory.Amount 1
	Inventory.MaxAmount 100
	Ammo.BackpackAmount 0
	Ammo.BackpackMaxAmount 100
	Inventory.Icon "CUBXA0"
}

ACTOR CubeLightning : FastProjectile
{
  Speed 50
  Radius 11
  Height 6
  Damage 1
  Renderstyle Add
  //ReactionTime 5
  +RIPPER
  +CANNOTPUSH
  +BLOODLESSIMPACT
  DamageType Fire
  MissileType "CubeLightningTrailSpawner"
  states
  {
  Spawn:
    TNT1 A 2
  Looplet:
    TNT1 A 0 //A_Countdown
    TNT1 A 1 A_ChangeVelocity (frandom(-22,22), frandom(-22, 22), frandom(-10, 10), 0)
    TNT1 A 1 A_ChangeVelocity (frandom(-22,22), frandom(-22, 22), frandom(-10, 10), 0)
    TNT1 A 1 A_ChangeVelocity (frandom(-22,22), frandom(-22, 22), frandom(-10, 10), 0)
    Stop
  Ded:
    TNT1 A 1
    stop
  }
}

ACTOR CubeLightningTrailSpawner
{
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOGRAVITY
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 2 A_SpawnItemEx("CubeLightningTrail",frandom(2.0,-2.0),frandom(2.0,-2.0),4+frandom(2.0,-2.0),0,0,0,0,0,0)
    Stop
  }
}
ACTOR CubeLightningTrail
{
  RenderStyle Add
  Scale 0.07
  Alpha 0.8
  +CLIENTSIDEONLY
  +NOINTERACTION
  +NOGRAVITY
  States
  {
  Spawn:
    TNT1 A 0
    CUBS ABCDE 2 bright A_FadeOut(0.1)
  Trolololo:
    TNT1 A 0 //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    CUBS F 1 bright A_FadeOut(0.08)
    Loop
  }
}

//Alt-Fire

ACTOR WTFRocket : Rocket
{
  Speed 25
  SeeSound "weapons/rocklf2"
  DeathSound "weapons/rocklx2"
  Obituary  "%o was smeared by %k's gibberish rainbow missile wave."
  
  -ROCKETTRAIL
  States
  {
  Spawn:
    MISL A 1
    Loop
  Death:
    MISL B 6 Bright A_Explode(100,128,0)
    MISL C 4 Bright
    MISL D 2 Bright
    Stop
  }
}

ACTOR WTFPlasmaBall : PlasmaBall
{
  Speed 25
  SeeSound "weapons/plasmaf2"
  DeathSound "weapons/plasmax2"
  Obituary "%o was melted by %k's gibberish rainbow plasma ball wave."
  States
  {
  Spawn:
    PLSS AB 5 Bright
    Loop
  Death:
    PLSE ABCDE 3 Bright
    Stop
  }
}

ACTOR WTFRocketRed : WTFRocket
{
  Translation "64:79=176:191", "128:151=176:191"
}

ACTOR WTFRocketGreen : WTFRocket
{
  Translation "64:79=112:127", "128:151=112:127"
}

ACTOR WTFRocketBlue : WTFRocket
{
  Translation "64:79=192:207", "128:151=192:207"
}

ACTOR WTFRocketYellow : WTFRocket
{
  Translation "144:151=160:167", "128:135=224:231", "136:143=160:167"
}

ACTOR WTFPlasmaBallRed : WTFPlasmaBall
{
  Translation "192:207=176:191"
}

ACTOR WTFPlasmaBallGreen : WTFPlasmaBall
{
  Translation "192:207=112:127"
}

ACTOR WTFPlasmaBallYellow : WTFPlasmaBall
{
  Translation "192:199=224:231", "200:207=160:167"
}

//Reload

actor CubeInfiniteAmmo : PowerupGiver
{
  inventory.pickupmessage "I AM FULL OF SANDWICH, AND I AM COMING FOR YOU!"
  powerup.duration -30
  powerup.type "InfiniteAmmo"
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ADDITIVETIME
  powerup.color "70 0 99" 0.03
  states
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

actor CubeInvicibility : PowerupGiver
{
  inventory.pickupmessage "HAHAHAHAAA!! I AM BULLETPROOOOOOF!!"
  powerup.duration -30
  powerup.type "Invulnerable"
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ADDITIVETIME
  powerup.color Orange 0.03
  states
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

actor PowerCubeDamage : PowerDamage
{
damagefactor "normal", 2.0
inventory.icon "TNT1A0"
}

actor CubeDamage : PowerupGiver
{
  inventory.pickupmessage "IT'S TIME TO RUN, COWARDS!"
  powerup.duration -30
  powerup.type "CubeDamage"
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ADDITIVETIME
  powerup.color Red 0.03
  states
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

actor PowerCubeProtect : PowerProtection
{
damagefactor "normal", 0.5
inventory.icon "TNT1A0"
}

actor CubeProtection : PowerupGiver
{
  inventory.pickupmessage "YOU ARE NO MATCH FOR MEE!!"
  powerup.duration -30
  powerup.type "CubeProtect"
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ADDITIVETIME
  powerup.color Cyan 0.03
  states
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

actor CubeFear : PowerupGiver
{
  inventory.pickupmessage "FEAR ME, COWAAAARDS!!"
  powerup.duration -30
  powerup.type "Frightener"
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ADDITIVETIME
  powerup.color Yellow 0.03
  states
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}